package com.mall.module.product.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

@ApiModel("新增商品请求")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ProductCreateDTO {
    @ApiModelProperty(value = "SPU基本信息", required = true)
    @Valid
    @NotNull(message = "商品基本信息不能为空")
    private ProductSpuDTO spuInfo;

    @ApiModelProperty(value = "SKU列表", required = true)
    @Valid
    @Size(min = 1, message = "至少需要1个SKU")
    private List<ProductSkuDTO> skuList;

    @ApiModelProperty(value = "商品属性列表")
    @Valid
    private List<ProductAttributeDTO> attributes;

    @ApiModelProperty(value = "营销信息")
    @Valid
    private ProductMarketingDTO marketingInfo;
    
    @ApiModelProperty(value = "创建者ID", hidden = true)
    private Long createUser;
    
    @ApiModelProperty(value = "创建时间", hidden = true)
    private LocalDateTime createTime;
}
